package prueba;

import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Form;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;

public class HolaVerano extends MIDlet implements CommandListener{
	Command command;
	Command despedida;
	Form form;
	public HolaVerano() {
		// TODO Auto-generated constructor stub
		Display display=Display.getDisplay(this);
		form=new Form("HOLA Verano");
		display.setCurrent(form);
		command=new Command("saludo",Command.ITEM,1);
		despedida=new Command("despedida",Command.ITEM,1);
		form.addCommand(command);
		form.addCommand(despedida);
		form.setCommandListener(this);
	}

	protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
		// TODO Auto-generated method stub

	}

	protected void pauseApp() {
		// TODO Auto-generated method stub

	}

	protected void startApp() throws MIDletStateChangeException {
		// TODO Auto-generated method stub

	}

	public void commandAction(Command arg0, Displayable arg1) {
		// TODO Auto-generated method stub
		if(arg0.equals(command)){
		form.append("Que bien esta todo!");
		}
		if(arg0.equals(despedida)){
		form.deleteAll();
		form.append("Hasta Luego!");
		}
	}

}
